//
//  LBImageCell.m
//  LBMiddleExpandLoopView_Example
//
//  Created by liubo on 2023/9/21.
//  Copyright © 2023 liubo. All rights reserved.
//

#import "LBViewCell.h"

@implementation LBViewCell

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        self.clipsToBounds = YES;
        self.backgroundColor = [UIColor cyanColor];
        [self addSubview:self.imageView];
        [self addSubview:self.coverView];
    }
    return self;
}

- (void)handleTapGesture:(UITapGestureRecognizer *)tap {
    !self.didCellClick ? : self.didCellClick(self.tag);
}

- (void)setupCellFrame:(CGRect)frame {
    if (CGRectEqualToRect(self.imageView.frame, frame)) return;
    
    self.imageView.frame = frame;
    self.coverView.frame = frame;
}

#pragma mark - 懒加载
- (UIImageView *)imageView {
    if (!_imageView) {
        _imageView = [UIImageView new];
        _imageView.frame = CGRectMake(0, 0, 300, 400);
    }
    return _imageView;
}

- (UIView *)coverView {
    if (!_coverView) {
        _coverView = [UIView new];
        _coverView.backgroundColor = [UIColor blackColor];
       // _coverView.frame = CGRectMake(0, 0, ceilf(kAdapter(560.0f)), kAdapter(850.0f));
        _coverView.userInteractionEnabled = NO;
    }
    return _coverView;
}


@end
